Present society is heavily reliant on computer software (referred to herein as “software”). The software is often complex with portions of a single piece of software performed by several different processors, e.g., in a symmetric multi-processing (SMP) environment. Due to this complexity and heavy reliance, methods and apparatus for verifying the proper execution of software are useful.
“Tracing” is a common mechanism for verifying proper execution of software. In this mechanism, instructions are inserted into the software to store specified diagnostic information into a common buffer during execution of the software. In software for which execution speed is critical, there is a conflict between gathering diagnostic information and execution speed because each instruction to gather diagnostic information adversely affects the execution speed of the software.
This conflict is even more significant in software designed to operate in a multi-processor environment such as an SMP environment because exclusive access to the common buffer is required to make an entry into the common buffer. For example, if one processor is making an entry to the common buffer all other processors in the SMP environment executing an instruction to make an entry to the common buffer remain idle until the current processor releases the common buffer for access by a subsequent processor.
To address the conflict between gathering diagnostic information and execution speed, instructions inserted for gathering diagnostic information are present during the development of software and then may be bypassed or deleted when the software is put into actual use. Accordingly, diagnostic information beneficial to the development of the software is unavailable for diagnosis during actual use.
It is often desirable to diagnose software after development. Accordingly, improved methods and apparatus for gathering diagnostic information that are not subject to the above limitations are needed. The present invention addresses this need among others.